﻿unit NewRepParamFrm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, dxSkinsCore, dxSkinMcSkin, dxSkinSeven, cxLabel, cxControls,
  cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit, cxCalendar,
  Menus, cxLookAndFeelPainters, StdCtrls, cxButtons, cxPropertiesStore,
  cxGraphics, cxLookAndFeels, dxSkinOffice2010Black, dxSkinOffice2010Blue,
  dxSkinOffice2010Silver;

type
  TNewRepParamForm = class(TForm)
    dt1: TcxDateEdit;
    lbl1: TcxLabel;
    lbl2: TcxLabel;
    btn1: TcxButton;
    dt2: TcxDateEdit;
    prop1: TcxPropertiesStore;
    edt_ym: TcxTextEdit;
    edt_reestr: TcxTextEdit;
    procedure dt1PropertiesChange(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  NewRepParamForm: TNewRepParamForm;

implementation

{$R *.dfm}

{ -------------------------------------------------------------------------------
  dt1PropertiesChange | YM
  ------------------------------------------------------------------------------- }
procedure TNewRepParamForm.dt1PropertiesChange(Sender: TObject);
begin
  // lbl2
  lbl2.Caption := FormatDateTime('YY', dt1.Date) + FormatDateTime('MM',
    dt1.Date);
end;

procedure TNewRepParamForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := caFree;
end;

procedure TNewRepParamForm.FormCreate(Sender: TObject);
begin
  prop1.StorageName := ExtractFilePath(Application.ExeName) + 'config\LoadRep';
  prop1.Active := True;
  if FileExists(ExtractFilePath(Application.ExeName) + 'config\LoadRep') then
    prop1.RestoreFrom;
end;

end.
